package com.yunjing.tabdemo;



import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class TabEntity implements Serializable {


    /**
     * 获取tab集合数据
     * @param isAlong true:发料  false:倒运
     * @return
     */
    public static List<TabEntity> getTabEntities(boolean isAlong) {
        List<TabEntity> tabEntities = new ArrayList<>();
        if (isAlong) {

            tabEntities.add(new TabEntity("待发料", 0, isAlong));
            tabEntities.add(new TabEntity("地面电机车", 1, isAlong));
            tabEntities.add(new TabEntity("提升机", 2, isAlong));
            tabEntities.add(new TabEntity("井下电机车", 3, isAlong));
            tabEntities.add(new TabEntity("胶轮车换装站", 4, isAlong));
            tabEntities.add(new TabEntity("胶轮车", 5, isAlong));
            tabEntities.add(new TabEntity("单轨吊换装站", 6, isAlong));
            tabEntities.add(new TabEntity("单轨吊", 7, isAlong));
            tabEntities.add(new TabEntity("待验收", 8, isAlong));
            tabEntities.add(new TabEntity("已完成", 9, isAlong));
            tabEntities.add(new TabEntity("待倒运", 10, isAlong));
        } else {
            tabEntities.add(new TabEntity("待倒运", 10, isAlong));
            tabEntities.add(new TabEntity("单轨吊", 7, isAlong));
            tabEntities.add(new TabEntity("单轨吊换装站", 6, isAlong));
            tabEntities.add(new TabEntity("胶轮车", 5, isAlong));
            tabEntities.add(new TabEntity("胶轮车换装站", 4, isAlong));
            tabEntities.add(new TabEntity("井下电机车", 3, isAlong));
            tabEntities.add(new TabEntity("提升机", 2, isAlong));
            tabEntities.add(new TabEntity("地面电机车", 1, isAlong));
            tabEntities.add(new TabEntity("待验收", 8, isAlong));
            tabEntities.add(new TabEntity("已完成", 9, isAlong));
            tabEntities.add(new TabEntity("待发料", 0, isAlong));
        }

        return tabEntities;
    }

    public static String[] getPageNames(List<TabEntity> orderTitleEntities) {
        if (orderTitleEntities!=null) {
            String[] pageNames = new String[orderTitleEntities.size()];
            for (int i = 0; i < orderTitleEntities.size(); i++) {
                pageNames[i] = orderTitleEntities.get(i).getTabName();

            }
            return pageNames;
        }
        return null;
    }

    //tab名称
    private String tabName;
    //tab下标
    private int position;
    //是否是发料的顺序，true:发料  false:倒运
    private boolean isAlong;


    public TabEntity() {

    }

    public TabEntity(String tabName, int position, boolean isAlong) {
        this.tabName = tabName;
        this.position = position;
        this.isAlong = isAlong;
    }

    public String getTabName() {
        return tabName;
    }

    public void setTabName(String tabName) {
        this.tabName = tabName;
    }

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    public boolean isAlong() {
        return isAlong;
    }

    public void setAlong(boolean along) {
        isAlong = along;
    }


}
